<?php


namespace app\common\model;


use think\Model;

class BusinessUnitModel extends Model
{
    protected $name = 'wdsxh_member_unit';

    /**
     * 获取列表
     * @return array
     */
    public function getList(): array
    {
        try {
            $where = [
                'status' => 1,
            ];
            $field = 'id,member_id,company_name';
            $order = [
                'weigh' => 'desc',
            ];
            $list = $this
                ->field($field)
                ->where($where)
                ->order($order)
                ->select();
            return [
                'code' => 200,
                'msg' => '请求成功',
                'data' => $list
            ];
        }catch (\Exception $e) {
            return [
                'code' => $e->getCode(),
                'msg' => $e->getMessage(),
                'data' => []
            ];
        }
    }

}